<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont icon-return back-icon"></span>
    </div>
    <div class="header-input">
      <span class="iconfont icon-search search-icon"></span>
      输入城市/景点/游玩主题
    </div>
    <div class="header-right">
     <span @click="goCity">{{this.city}}</span>
     <span class="iconfont icon-n-arrowDown"></span>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'Header',
  computed: {
    ...mapState(['city'])
  },
  methods: {
    goCity () {
      this.$router.push('/city')
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~@/assets/styles/varibles.styl'
  .header
   display:flex
   align-items center
   height .86rem
   background-color $bgColor
   color #fff
   .header-left
    width:.64rem
    .back-icon
     font-size .5rem
     display block
     text-align center
   .header-input
     flex: 1
     padding-left .2rem
     background-color #fff
     color #ccc
     border-radius .05rem
     height .64rem
     display flex
     align-items center
     margin-left .2rem
     .search-icon
      font-size .42rem
   .header-right
    min-width: 1.04rem
    padding 0 .1rem
    text-align center
</style>
